<?php
/**
 * Created by JetBrains PhpStorm.
 * User: T420
 * Date: 9/27/12
 * Time: 11:08 PM
 * To change this template use File | Settings | File Templates.
 */
class Models_Login extends Libs_Model
{
    public function __construct()
    {
        parent::__construct();
    }
    public function checklogin($username,$password)
    {
        $password=md5($password);
        $this->db->connect();

        $listuser=$this->db->executeQuery("select * from lb_users where username='$username' and password='$password' ");
        $this->db->disconnect();
        return $listuser;
    }
    public function getinfouser($user)
    {
        $this->db->connect();

        $listuser=$this->db->executeQuery("select * from lb_users where username='$user' ");
        $this->db->disconnect();
        return $listuser;
    }
    public function changepass($id,$pass)
    {
        $this->db->connect();

        $this->db->queryinsert("update lb_users set password=md5('$pass') where userid='$id' ");
        $this->db->disconnect();

    }

}
